package com.example.pingze.controller;

import com.example.pingze.entity.Sentence;
import com.example.pingze.service.SentenceFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sentence")
@CrossOrigin(origins = "*")
public class SentenceFileController {
    @Autowired
    private SentenceFileService service;
    @GetMapping("/add1")
    public void addSentence(){
        List<Sentence> list = service.fromJson();
        service.insertSentence(list);
    }
}
